#两数相加

class Solution(object):
    def twoSum(self, nums, target):
        """
        :type nums: List[int]
        :type target: int
        :rtype: List[int]
        """
        for i in range(len(nums)):
            for j in range(i+1,len(nums)):
                wa = nums[i]+nums[j]
                if wa == target:
                    return [i,j]
        return []

nums = [2, 7, 11, 15]
target = 9
solution = Solution()
# 通过实例调用 twoSum 方法
result = solution.twoSum(nums, target)
print(result)
